<template>
	<satri-page :padding="20">
		<satri-dialog title="标题" v-model="visible">
			<text>云想衣裳花想容，春风拂槛露华浓。若非群玉山头见，会向瑶台月下逢。</text>
		</satri-dialog>

		<satri-dialog :ref="setRefs('d1')">
			<text>云想衣裳花想容，春风拂槛露华浓。若非群玉山头见，会向瑶台月下逢。</text>
		</satri-dialog>

		<satri-dialog :ref="setRefs('d2')" title="标题">
			<text>云想衣裳花想容，春风拂槛露华浓。若非群玉山头见，会向瑶台月下逢。</text>

			<template #footer>
				<satri-button @tap="refs.d2?.close()">好诗！</satri-button>
			</template>
		</satri-dialog>

		<satri-card label="基础用法">
			<satri-button @tap="open">打开</satri-button>
		</satri-card>

		<satri-card label="无标题">
			<satri-button @tap="refs.d1?.open()">打开</satri-button>
		</satri-card>

		<satri-card label="带按钮">
			<satri-button @tap="refs.d2?.open()">打开</satri-button>
		</satri-card>
	</satri-page>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { useSatri } from "/@/satri";

const { refs, setRefs } = useSatri();

const visible = ref(false);

function open() {
	visible.value = true;
}
</script>
